{$CLEO .qa}
{$USE CLEO+}
{$USE newOpcodes}
{$USE ini}

0000: NOP

script_name "BASKSH"

// By ArtemQa146

0AF0: 0@ = read_int_from_ini_file "cleo\Busy Pedestrians.ini" section "Settings" key "Shopping basket"
if
    0@ == 0
then
    0A93: terminate_this_custom_script
end

const
    render_model_1 = 31@
    render_model_2 = 30@
    render_model_3 = 29@
    ped_actor = 28@
    find = 27@
end


        077E: get_active_interior_to 1@
        if or
            1@ == 6
            1@ == 4
            1@ == 18
        then
            if or
                0EEA: locate_char_distance_to_coordinates $player_actor pos -27.8786 -81.1702 1003.5469 radius 30.0
                0EEA: locate_char_distance_to_coordinates $player_actor pos -28.2176 -51.7941 1003.5469 radius 30.0
                0EEA: locate_char_distance_to_coordinates $player_actor pos -30.9906 -14.84 1003.5573 radius 50.0
            then
                find = 0
                while get_any_char_no_save_recursive find progress_to find char_to ped_actor
                    0EFF: get_char_simplest_active_task ped_actor id_to 1@ pointer_to 2@
                    if and
                        1@ == 900
                        0EE4: locate_char_distance_to_char $player_actor char ped_actor radius 20.0
                    then
                        0209: 2@ = random_int_in_ranges 1 4
                        if 2@ == 1
                        then 0AF0: 1@ = read_int_from_ini_file "cleo\PedsModels.ini" section "Models" key "sh_basket_1"
                        end
                        if 2@ == 2
                        then 0AF0: 1@ = read_int_from_ini_file "cleo\PedsModels.ini" section "Models" key "sh_basket_2"
                        end
                        if 2@ == 3
                        then 0AF0: 1@ = read_int_from_ini_file "cleo\PedsModels.ini" section "Models" key "sh_basket_3"
                        end
                        0F02: create_render_object_to_char_bone_from_special ped_actor special_model 1@ bone 34 offset 0 0 0 rotation 0 0 0 store_to 1@
                        0E37: set_render_object_scale 1@ 1.2 1.2 1.0
                        repeat
                        wait 0
                        077E: get_active_interior_to 1@
                        until 1@ == 0
                        0A93: terminate_this_custom_script
                        break
                    end
                end
            end
        end
        
0A93: terminate_this_custom_script
